﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Buttons : MonoBehaviour
{
    Button[] buttons;
    CloudMask cloud_mask;
    public Transform t;
    // Start is called before the first frame update
    void Start()
    {
        buttons = FindObjectsOfType<Button>();
        foreach(var b in buttons)
        {
            b.onClick.AddListener(() => OnButtonClicked(b));
        }
        cloud_mask = t.GetComponent<CloudMask>();
        Debug.Log(cloud_mask);
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    void OnButtonClicked(Button b)
    {
        Debug.Log(b.name);
        switch (b.name)
        {
            case "Start":
                cloud_mask.status = 1;
                cloud_mask.scene_name = "fei-test";
                break;
            default:
                break;
        }
    }
}
